package com.fencing_squad.homo;

import com.fencing_squad.homo.map_util.util.PermissionsUtils;
import com.fencing_squad.homo.slice.MainSlice;
import com.fencing_squad.homo.slice.SupervisorSlice;
import com.fencing_squad.homo.slice.TestSlice;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.ability.AbilitySliceAnimator;
import ohos.aafwk.content.Intent;
import ohos.agp.window.service.Window;
import ohos.agp.window.service.WindowManager;
import ohos.security.SystemPermission;

public class MainAbility extends Ability {

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setMainRoute(MainSlice.class.getName());
//        super.setMainRoute(TestSlice.class.getName());
//        super.setMainRoute(SupervisorSlice.class.getName());
//        setAbilitySliceAnimator(null);
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutConfig.MARK_TRANSLUCENT_NAVIGATION);
        window.addFlags(WindowManager.LayoutConfig.MARK_TRANSLUCENT_STATUS);
    }

    @Override
    public void onRequestPermissionsFromUserResult(int requestCode, String[] permissions, int[] grantResults) {
        super.onRequestPermissionsFromUserResult(requestCode, permissions, grantResults);
        PermissionsUtils.getInstance().onRequestPermissionsResult(requestCode, permissions, grantResults);
    }
}
